import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/standing_book/interrupt_record_entity.dart';

InterruptRecordEntity $InterruptRecordEntityFromJson(Map<String, dynamic> json) {
  final InterruptRecordEntity interruptRecordEntity = InterruptRecordEntity();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    interruptRecordEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    interruptRecordEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    interruptRecordEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    interruptRecordEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    interruptRecordEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    interruptRecordEntity.id = id;
  }
  final String? interruptDate = jsonConvert.convert<String>(json['interruptDate']);
  if (interruptDate != null) {
    interruptRecordEntity.interruptDate = interruptDate;
  }
  final String? interruptReason = jsonConvert.convert<String>(json['interruptReason']);
  if (interruptReason != null) {
    interruptRecordEntity.interruptReason = interruptReason;
  }
  final String? interruptSign = jsonConvert.convert<String>(json['interruptSign']);
  if (interruptSign != null) {
    interruptRecordEntity.interruptSign = interruptSign;
  }
  final String? interruptStartDate = jsonConvert.convert<String>(json['interruptStartDate']);
  if (interruptStartDate != null) {
    interruptRecordEntity.interruptStartDate = interruptStartDate;
  }
  final String? interruptUserId = jsonConvert.convert<String>(json['interruptUserId']);
  if (interruptUserId != null) {
    interruptRecordEntity.interruptUserId = interruptUserId;
  }
  final String? interruptUserName = jsonConvert.convert<String>(json['interruptUserName']);
  if (interruptUserName != null) {
    interruptRecordEntity.interruptUserName = interruptUserName;
  }
  final String? ticketPlanId = jsonConvert.convert<String>(json['ticketPlanId']);
  if (ticketPlanId != null) {
    interruptRecordEntity.ticketPlanId = ticketPlanId;
  }
  final String? ticketReceiptId = jsonConvert.convert<String>(json['ticketReceiptId']);
  if (ticketReceiptId != null) {
    interruptRecordEntity.ticketReceiptId = ticketReceiptId;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    interruptRecordEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    interruptRecordEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    interruptRecordEntity.updateDate = updateDate;
  }
  return interruptRecordEntity;
}

Map<String, dynamic> $InterruptRecordEntityToJson(InterruptRecordEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['interruptDate'] = entity.interruptDate;
  data['interruptReason'] = entity.interruptReason;
  data['interruptSign'] = entity.interruptSign;
  data['interruptStartDate'] = entity.interruptStartDate;
  data['interruptUserId'] = entity.interruptUserId;
  data['interruptUserName'] = entity.interruptUserName;
  data['ticketPlanId'] = entity.ticketPlanId;
  data['ticketReceiptId'] = entity.ticketReceiptId;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension InterruptRecordEntityExtension on InterruptRecordEntity {
  InterruptRecordEntity copyWith({
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    String? interruptDate,
    String? interruptReason,
    String? interruptSign,
    String? interruptStartDate,
    String? interruptUserId,
    String? interruptUserName,
    String? ticketPlanId,
    String? ticketReceiptId,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return InterruptRecordEntity()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..interruptDate = interruptDate ?? this.interruptDate
      ..interruptReason = interruptReason ?? this.interruptReason
      ..interruptSign = interruptSign ?? this.interruptSign
      ..interruptStartDate = interruptStartDate ?? this.interruptStartDate
      ..interruptUserId = interruptUserId ?? this.interruptUserId
      ..interruptUserName = interruptUserName ?? this.interruptUserName
      ..ticketPlanId = ticketPlanId ?? this.ticketPlanId
      ..ticketReceiptId = ticketReceiptId ?? this.ticketReceiptId
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
